﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Ex05.MemoryGameLogic
{
    public class Player
    {
        private string m_Name;

        public string Name
        {
            get { return m_Name; }
            set { m_Name = value; }
        }

        public Player()
        {
        }

        public Player(string i_PlayerName)
        {
            this.Name = i_PlayerName;
        }

        public override bool Equals(object obj)
        {
            bool equals = false;

            Player player = obj as Player;

            if (obj != null)
            {
                if (m_Name == player.m_Name)
                {
                    equals = true;
                }
            }

            return equals;
        }

        public override int GetHashCode()
        {
            return m_Name.GetHashCode();
        }
    }
}
